'use strict'

class getlendata {
  constructor() {
    this.param = '/'
  }

  async get(c) {
    let adminLen = await c.service.psql.query(`select * from manage`)
    let musicLen = await c.service.psql.query(`select * from music`)
    let videoLen = await c.service.psql.query(`select * from video`)
    let jokeLen = await c.service.psql.query(`select * from joke`)
    let obj = {
      adminlen: adminLen.rows.length,
      musicLen: musicLen.rows.length,
      videoLen: videoLen.rows.length,
      jokeLen: jokeLen.rows.length
    }
    c.status(200).send(obj)
  }

}

module.exports = getlendata
